#include<bits/stdc++.h>
using namespace std;
string s;
int k,n;
long long dfs(int l,int r,int type){//1-(S) 2-(S* 3-*S) 4-*S*\
	////////////////////////////////////////////
	//cout<<l<<" "<<r<<" "<<type<<endl;
	////////////////////////////////////////////
	if(l>r)return 0;
	if(l==r&&(type==1||type==4))return 1;
	long long ans=0;
	switch(type){
		case 1:
			if(!((s[r-1]==')'||s[r-1]=='?')&&(s[l]=='('||s[l]=='?')))return 0;
			if(r-l==1)return 0;
			if(r-l==2)return 1;
			ans=dfs(l+1,r-1,1)+dfs(l+1,r-1,2)+dfs(l+1,r-1,3)+dfs(l+1,r-1,4);
			///////////////////////////////
			//cout<<l<<" "<<r<<" "<<ans<<"14"<<endl<<endl;
			///////////////////////////////
			ans%=1000000007;
			for(int i=l+1;i<r-2;i++){
				if((s[i]==')'||s[i]=='?')&&(s[i+1]=='('||s[i+1]=='?')){
					ans+=dfs(l,i+1,1)*dfs(i+1,r,1);
					///////////////////////////////
			//cout<<l<<" "<<r<<" "<<ans<<"13"<<endl<<endl;
			///////////////////////////////
					ans%=1000000007;
				}
				if((s[i]==')'||s[i]=='?')&&(s[i+1]=='*'||s[i+1]=='?')){
					ans+=dfs(l,i+1,1)*dfs(i+1,r,3);
					///////////////////////////////
			//cout<<l<<" "<<r<<" "<<ans<<"12"<<endl<<endl;
			///////////////////////////////
					ans%=1000000007;
				}
			}
			///////////////////////////////
			//cout<<l<<" "<<r<<" "<<ans<<"11"<<endl<<endl;
			///////////////////////////////
			return ans;
			break;
		case 2:
			if(r-l==1)return 0;
			if(!((s[r-1]=='*'||s[r-1]=='?')&&(s[l]=='('||s[l]=='?')))return 0;
			for(int i=l+1;i<r-1;i++){
				if(s[i]==')'||s[i]=='?'){
					ans+=dfs(l,i+1,1)*dfs(i+1,r,4)+dfs(l,i+1,1)*dfs(i+1,r,2);
					ans%=1000000007;
				}
			}
			///////////////////////////////
			//cout<<l<<" "<<r<<" "<<ans<<"2"<<endl;
			////////////////////////////////
			return ans;
			break;
		case 3:
			if(r-l==1)return 0;
			if(!((s[r-1]==')'||s[r-1]=='?')&&(s[l]=='*'||s[l]=='?')))return 0;
			for(int i=l+1;i<r-1;i++){
				if(s[i]=='('||s[i]=='?'){
					ans+=dfs(l,i,4)*dfs(i,r,1)+dfs(l,i,3)*dfs(i,r,1);
					ans%=1000000007;
				}
			}
			///////////////////////////////
			//cout<<l<<" "<<r<<" "<<ans<<"3"<<endl;
			///////////////////////////////
			return ans;
			break;
		case 4:
			if(r-l>k)return 0;
			if(!((s[r-1]=='*'||s[r-1]=='?')&&(s[l]=='*'||s[l]=='?')))return 0;
			if(l>r)return 0;
			for(int i=l;i<r;i++)if(s[i]=='('||s[i]==')')return 0;
			////////////////////////////////////////////
			//cout<<l<<" "<<r<<" "<<"4"<<endl;
			////////////////////////////////////////////
			return 1;
			break;
	}
}
int main(){
	//freopen("bracket.in","r",stdin);
	//freopen("bracket.out","w",stdout);
	cin>>n>>k>>s;
	cout<<dfs(0,n,1)<<endl;
	return 0;
}
